package com.caidan.security.controller;

import com.caidan.security.domain.dto.LoginParams;
import com.caidan.security.service.IUmsSysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("auth")
public class AuthController {

    @Autowired
    private IUmsSysUser service;

    @PostMapping("login")
    public String login(@RequestBody LoginParams loginParams) {
        String token = service.login(loginParams);
        return token;
    }
}
